package com.milk.nettylearn.nio;

import java.nio.ByteBuffer;

import static com.milk.nettylearn.nio.ByteBufferUtil.debugAll;

public class TestByteBuffer {
    public static void main(String[] args) {
        ByteBuffer buffer = ByteBuffer.allocate(10);
        buffer.put((byte) 97);
        debugAll(buffer);

        buffer.put(new byte[]{0x62, 0x63, 0x64});
        debugAll(buffer);

        buffer.flip();
        debugAll(buffer);

        System.out.println("读取结果:" + buffer.get());
        debugAll(buffer);

        buffer.compact();
        debugAll(buffer);

    }
}
